package com.kang.service.impl;

import com.kang.entity.Field;
import com.kang.entity.Table;
import com.kang.mapper.TableMapper;
import com.kang.service.TableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: Java_new_sql
 * @description:
 * @author: K.faWu
 * @create: 2021-06-15 18:12
 **/
@Service
public class TableSerivceImpl implements TableService {

    @Autowired
    private TableMapper tableMapper;

    @Override
    public void addTable(Table table) {
        //创建表，设置默认字段 id、del_flag(是否删除)
        tableMapper.addTable(table);
        //添加其他字段
        for(Field field: table.getFieldList()){
            tableMapper.addField(field);
        }
    }
}
